package Text;

public class Peopel {
    String name;
    public int num;

    public Peopel(String name, int num) {
        this.name = name;
        this.num = num;
    }
    public boolean equals(Object obj){
        if(this==obj){
            return true;
        }
        if(obj instanceof Peopel){
            if(((Peopel) obj).getName()==this.name&&((Peopel)obj).getNum()==this.getNum())
            {
                return true;
            }
            return false;
        }
        return false;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
    @Override
    public String toString() {
        return "Peopel{" +
                "name='" + name + '\'' +
                ", num=" + num +
                '}';
    }
}
